import { RouteObject } from 'react-router-dom'
import { Login, NotFound, DashBoard, Drag } from '../pages'
import { BasicLayout, BlankLayout } from '../layouts'

const routes: RouteObject[] = [
  {
    path: '/',
    element: <BlankLayout />,
    children: [
      {
        // path: 'login',
        index: true,
        // title: 'name',
        element: <Login />,
      },
      {
        path: 'drag',
        element: <Drag />,
      },
      // {
      //   // path: '/a',
      //   index: true, // 在嵌套路由中，如果URL仅匹配了父级URL，则Outlet中会显示带有index属性的路由
      //   element: <A />,
      // },
    ],
  },
  {
    path: '/basic',
    element: <BasicLayout />,
    children: [
      {
        path: 'dashboard',
        index: true,
        element: <DashBoard />,
      },
    ],
  },

  {
    path: '*',
    element: <NotFound />,
  },
]

export default routes
